package com.maxd.service.userMoney;


import com.maxd.model.UserMoneyDetails;
import com.maxd.respository.userMoney.UserMoneyDetailsJpaRepository;
import com.maxd.respository.userMoney.UserMoneyDetailsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户信誉分数明细
 */
@Service
public class UserMoneyDetailsServiceImpl implements UserMoneyDetailsService {

    /** 用户金额明细 */
    @Autowired
    private UserMoneyDetailsJpaRepository userMoneyDetailsJpaRepository;
    /** 用户金额明细自定义方法类 */
    @Autowired
    private UserMoneyDetailsRepository userMoneyDetailsRepository;


    @Override
    public List<UserMoneyDetails> selectUserMoneyDetailsList(Long userId, Pageable pageable) {
        List<UserMoneyDetails> UserMoneyDetails= userMoneyDetailsRepository.selectById(userId,pageable);
        return UserMoneyDetails;
    }

    @Override
    public Integer save(UserMoneyDetails userMoneyDetails) {
        userMoneyDetailsJpaRepository.save(userMoneyDetails);
        return 1;
    }

}